package com.jollychic.www.roomdatebasedemo.model;

import android.arch.persistence.room.ColumnInfo;
import android.arch.persistence.room.Entity;
import android.arch.persistence.room.ForeignKey;
import android.arch.persistence.room.Index;
import android.arch.persistence.room.PrimaryKey;
import android.support.annotation.NonNull;

import static android.arch.persistence.room.ForeignKey.CASCADE;

/**
 * desc:  <br/>
 * author: 李超杰 <br/>
 * date: 2018/5/19 下午9:54 <br/>
 * since v <br/>
 */
@Entity(tableName = "Drinks",foreignKeys = @ForeignKey(entity = StoreEntity.class
        ,parentColumns = "storeId"
        ,childColumns = "store_id"
        , onDelete = CASCADE))
public class DrinksEntity {

    @PrimaryKey(autoGenerate = true)
    public int drinksId;

    public double drinkPrice;
    public String drinkBrand;

    @ColumnInfo(name = "store_id")
    public String storeId;

    public DrinksEntity() {
    }

    public DrinksEntity(double drinkPrice, String drinkBrand, String storeId) {
        this.drinkPrice = drinkPrice;
        this.drinkBrand = drinkBrand;
        this.storeId = storeId;
    }

    public double getDrinkPrice() {
        return drinkPrice;
    }

    public void setDrinkPrice(double drinkPrice) {
        this.drinkPrice = drinkPrice;
    }

    public String getDrinkBrand() {
        return drinkBrand;
    }

    public void setDrinkBrand(String drinkBrand) {
        this.drinkBrand = drinkBrand;
    }

    public String getStoreId() {
        return storeId;
    }

    public void setStoreId(String storeId) {
        this.storeId = storeId;
    }

}
